package com.kafka.spring.mq;

import com.kafka.spring.dto.NewCoffeeRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.stereotype.Component;

/**
 * 消费者监听
 */
@Component
@Slf4j
public class ConsumerListener {

    /**
     * 消费消息
     * @param coffeeRequest
     */
    @StreamListener(MqMessage.SEND_COFFEE)
    public void processNewOrder(NewCoffeeRequest coffeeRequest) {
        log.info("接受的消息：{}",coffeeRequest);
    }

}
